package edu.pku.sei.modeler.model.notation.shape;

import org.w3c.dom.Element;

import edu.pku.sei.modeler.model.notation.core.NotationPackage;
import edu.pku.sei.modeler.model.xml.XMLUtility;

public class Ellipse extends Shape {
	final static public int ELLIPSE = 0;
	final static public int CIRCLE = 1;
	
	private int type;
	
	public int getType(){
		return type;
	}
	
	/**
	 * @deprecated
	 */
	public Ellipse(){
		super();
		type = ELLIPSE;
	}
	
	static public Ellipse createEllipse(){
		Ellipse n = new Ellipse();
		n.type = ELLIPSE;
		
		return n;
	}
	static public Ellipse createCircle(){
		Ellipse n = new Ellipse();
		n.type = CIRCLE;
		
		return n;
	}
	//add by fengchao
	public void serialize(Element root) {
		super.serialize(root);
		XMLUtility.xmlInstance.serializeAttribute(root, NotationPackage.ELLIPSE_TYPE, type);
	}
	public void deSerialize(Element root) {
		super.deSerialize(root);
		type = XMLUtility.xmlInstance.deSerializeInt(root, NotationPackage.ELLIPSE_TYPE);
	}
	//end add
}
